package com.example.spirngbootdemo.controller;

import com.example.spirngbootdemo.async.AsyncManager;
import com.example.spirngbootdemo.bll.ITestBll;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @author Yang
 * create time 2021-10-18 19:19
 * @since 0.0.1
 */
@RestController
@Slf4j
public class IndexController {

    @Autowired
    private ITestBll testBll;
    @Autowired
    private AsyncManager asyncManager;

    @RequestMapping("get")
    public String get(){
        asyncManager.sayHello();
        log.info("get");
        testBll.getData("11");
        return "11";
    }

    @RequestMapping("log")
    public String log(){
        log.info("log");
        testBll.log();
        return "log";
    }

    @RequestMapping("log2")
    public String log2(){
        log.info("log2");
        testBll.log2();
        return "log2";
    }
}
